/*    */ package com.newcrm.webapi.sub;
/*    */ 
/*    */ import com.newcrm.bean.User;
/*    */ import com.newcrm.db.CustomerFieldManager;
/*    */ import com.newcrm.exception.NotFoundException;
/*    */ import com.newcrm.util.Util;
/*    */ import com.newcrm.webapi.AbstractAction;
/*    */ import com.newcrm.webapi.AbstractHttpServlet;
/*    */ import java.io.IOException;
/*    */ import java.io.PrintWriter;
/*    */ import java.util.List;
/*    */ import javax.servlet.ServletException;
/*    */ import javax.servlet.http.HttpServletRequest;
/*    */ import javax.servlet.http.HttpServletResponse;
/*    */ import net.sf.json.JSONObject;
/*    */ 
/*    */ public class ListAppCustomerFields extends AbstractAction
/*    */ {
/*    */   public ListAppCustomerFields(AbstractHttpServlet servlet)
/*    */   {
/* 25 */     super(servlet);
/*    */   }
/*    */ 
/*    */   public void parse(HttpServletRequest request, HttpServletResponse response)
/*    */     throws IOException, ServletException, NotFoundException
/*    */   {
/* 32 */     User user = super.getLoginUser(request);
/*    */ 
/* 34 */     int type = Util.getURLIntParameter(request.getParameter("type"));
/*    */ 
/* 36 */     CustomerFieldManager manager = new CustomerFieldManager();
/*    */ 
/* 38 */     List fields = manager.list(user.companyId, type);
/* 39 */     if (fields == null) {
/* 40 */       super.showErrorMessage(response, "备注信息加载失败");
/* 41 */       return;
/*    */     }
/*    */ 
/* 44 */     response.setContentType("text/html;charset=utf-8");
/* 45 */     PrintWriter out = response.getWriter();
/* 46 */     JSONObject jsonObject = new JSONObject();
/* 47 */     jsonObject.put("error", "0");
/* 48 */     jsonObject.put("fields", fields);
/* 49 */     out.println(jsonObject);
/* 50 */     out.flush();
/* 51 */     out.close();
/*    */   }
/*    */ }

/* Location:           C:\E\referenceProject\CRM参考\qikebao\WEB-INF\lib\qikebao.jar
 * Qualified Name:     com.newcrm.webapi.sub.ListAppCustomerFields
 * JD-Core Version:    0.6.1
 */